/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.bll;

import entity.Field_Event;
import java.util.List;
import model.dal.Field_EventDAL;

/**
 *
 * @author Hailk_c00639
 */
public class Field_EventBLL {
    Field_EventDAL fieldEventDAL = new Field_EventDAL();
    
    public List<Field_Event> getAllFieldEvent() {
        return fieldEventDAL.getAllFieldEvent();
    }
    
    public Field_Event getFieldEventByID(int fieldID) {
        return fieldEventDAL.getFieldEventByID(fieldID);
    }
    
    public Field_Event getFieldEventByName(String fieldName) {
        return fieldEventDAL.getFieldEventByName(fieldName);
    }
    
    public boolean insertFieldEvent(Field_Event fieldEvent) {
        return fieldEventDAL.insertFieldEvent(fieldEvent);
    }
    
    public boolean updateFieldEvent(Field_Event fieldEvent) {
        return fieldEventDAL.updateFieldEvent(fieldEvent);
    }
    
    public boolean deleteFieldEventByID(int fieldID) {
        try
        {
            fieldEventDAL.deleteFieldEventByID(fieldID);
            
            return true;
        }catch(Exception e)
        {
            return false;
        }
    }
    
    public boolean deleteFieldEventByName(String fieldName) {
        try
        {
            fieldEventDAL.deleteFieldEventByName(fieldName);
            
            return true;
        }catch(Exception e)
        {
            return false;
        }
    }
    
    public List<Field_Event> searchFieldEventByName(String fieldName) {
        return fieldEventDAL.searchFieldEventByName(fieldName);
    }
}
